﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QLNS.Models;
namespace QLNS.Controllers
{
    public class ChaDeptController : Controller
    {
        //
        // GET: /ChaDept/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Update(int id = 0)
        {
            CanBo listcb = CanBoModels.GetChiTietCanBo(id);
            ViewBag.DSCanBo = listcb;
            return View();
        }
        [HttpPost]
        public ActionResult Update(FormCollection fm, int id = 0)
        {
            CanBo cb = CanBoModels.GetChiTietCanBo(id);
            cb.IDPhongBan = Convert.ToInt32(fm["ListPhongBan"]);
            CanBoModels.Update(cb);
            return RedirectToAction("Index","Home");
        }

    }
}
